/*
https://leetcode.cn/problems/find-the-first-player-to-win-k-games-in-a-row/description/
3175. 找到连续赢 K 场比赛的第一位玩家
*/

class Solution {
public:
    int findWinningPlayer(vector<int>& skills, int k) {
        int ans=0;
        int mx=0;
        int n=skills.size();
        for(int i=1;i<n;i++)
        {
            if(skills[mx]>skills[i])
                ans++;
            else
            {
                mx=i;
                ans=1;
            }
                if(ans==k)
                return mx;
        }
        return mx;
    }
};